<!DOCTYPE html>
<html ng-app='test'>
  <head>
    <meta charset="utf-8">
    <title></title>
    <script src="angular.js"></script>
    <script type="text/javascript">
      let mod=angular.module('test',[]);

      mod.controller('main',function($scope,$http){
        $scope.calc=function()
        {
          $http.post('1.php',{
            a: $scope.a,
            b: $scope.b
          }).then(res=>{
          //  alert(res);
            console.log(res);
          },
          ()=>{
            alert('error');
          }
        );
        };
      });
    </script>
  </head>
  <body ng-controller='main'>
    <input type="text" name="" value="" ng-model='a'>
    <input type="text" name="" value="" ng-model='b'>
    <input type="button" name="" value="jisuan" ng-click='calc()'>
  </body>
</html>
